package hanjia;

import suanfa.ListNode;

/**
 * Description:
 * Author:    Dane
 * CreateTime:2025/2/5-下午2:56
 * Since  :   1.0
 * Version:   1.0
 */
public class LeetCode876 {

    public ListNode middleNode(ListNode head) {
          ListNode p1=head;
          ListNode p2=head;

          while (p2!=null&&p2.next!=null){
              p1=p1.next;
              p2=p2.next;
              p2=p2.next;
          }
          return p1;


    }
}
